<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
<link rel="stylesheet" href="/Public/css/reset.css">
<link rel="stylesheet" href="/Public/css/index.css">
<link rel="stylesheet" href="/Public/css/art.css">
</head>
<body>
    
    <header>
        <h1><a href="<?php echo U('home/index/index');?>">My Blog</a></h1>
        <h4>所有的伟大，源于一个勇敢的开始.</h4>
    </header>

    <nav>
        <ul>
            <?php if(is_array($top)): foreach($top as $key=>$value): ?><li><a href="<?php echo U('home/index/nav',array('cat_id'=>$value['cat_id'],'catname'=>$value['catname']));?>"><?php echo ($value['catname']); ?></a></li><?php endforeach; endif; ?>
        </ul>
    </nav>

    <div id="main">
        <div id="lside">
        <?php if(is_array($last)): foreach($last as $key=>$value): ?><article>
                <h2><a href="<?php echo U('home/index/art',array('art_id'=>$value['art_id']));?>"><?php echo ($value['title']); ?></a></h2>
                <div class="entry_header">
                    <time><?php echo ($value['pubtime']); ?></time>
                    by
                    <a href="#">Mr.z</a>
                    <span class="catlink" ><?php echo ($value['cat_id']); ?></span>
                    <span class="comment" ><?php echo ($value['comm']); ?></span>
                </div>
                <div class="entry_content">
                <?php echo ($value['content']); ?>
                </div>
            </article><?php endforeach; endif; ?>

        </div>


        <div id="rside">
            <aside>
                <form action="">
                    <input type="text" name="search" placeholder="Search...">
                </form>
            </aside>

            <aside>
                
                    <h4>今日天气</h4>
                    <ul>
                    <li><?php echo ($weather['string'][1]); ?></li><br/>
                    
                    

                    <li><?php echo ($weather['string'][10]); ?></li><br/>
                    </ul>
                
            </aside>
            
            <aside>
                <h4>最新文章</h4>
                <ul>
                <?php if(is_array($hot)): foreach($hot as $key=>$value): ?><li><a href="<?php echo U('home/index/art',array('art_id'=>$value['art_id']));?>"><?php echo ($value['title']); ?></a>&nbsp;&nbsp;(<?php echo ($value['comm']); ?>)</li><?php endforeach; endif; ?>
                </ul>
            </aside>


            <?php if(cookie_check() == 1): ?><aside>
                <form action="">
                    <h4>只能评论哦~</h4>
                    <ul>
                    <li><a href="<?php echo U('home/user/register');?>">注册</a></li>
                    <br/>                    
                    <li><a href="<?php echo U('home/user/logout');?>">退出登录</a></li>
                    </ul>
                </form>
            </aside>            
            <?php else: ?>
            <aside>
                <form action="">
                    <h4>只能评论哦~</h4>
                    <ul>
                    <li><a href="<?php echo U('home/user/login');?>">登录</a></li>
                    <br/>
                    <li><a href="<?php echo U('home/user/register');?>">注册</a></li>
                    </ul>
                </form>
            </aside><?php endif; ?>
        </div>
    </div>
    <footer>
        Copyright &copy; 2015 · GeneratePress · WordPress
    </footer>
</body>
</html>